Database queries have become increasingly complex. Often, a query or other operation on a database requires a sequence of operations. As a consequence, some developers use tools to model the operations, and the models may describe the sequence using elements such as calculation nodes. These calculation nodes can represent an operation, such as a projection, an aggregation, a join, a union, a minus, an intersection, and the like. To enable reuse and flexibility, developers often use a calculation scenario that describes the sequence in a general way, such as in the form of a data flow consisting of calculation nodes. In some instances, tools may be used to optimize the calculation scenario prior to execution on the underlying database.